<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"%>

<script type="text/javascript">
    function retireAction(submitAction) {
        Dialogs.saveTargetValue();
        afterSubmitRedirect("questionSet", "retire.html", submitAction, "submitAction");
    }
</script>

<jsp:include page="menu.jsp" />

<!--START: Subnav -->
<div class="sub_nav">
    <ul>
        <li>
            <img src="<%= request.getContextPath()%>/images/menu/sub_general_on.gif" alt="general" />
        </li>
    </ul>
</div>
<!--END: Subnav -->

<!--START: conent -->
<div id="general" class="content2">
    <div class="insider">
        <div class="corners">
            <div class="corners_top"></div>
            <div class="column1">
                <div class="col_l">
                    <table width="350" border="0" cellspacing="4" class="formlayout_table">
                        <tr>
                            <th width="188"><label>ID:</label></th>
                            <td width="240">${questionSet.refId}</td>
                        </tr>

                        <tr>
                            <th><label>Version:</label></th>
                            <td>${questionSet.version}</td>
                        </tr>
                        
                        <tr>
                            <th><label>Name:</label></th>
                            <td>${questionSet.name}</td>
                        </tr>
                        
                        <tr>
                            <th><label>Vocabulary Name:</label></th>
                            <td>${questionSet.vocabularyname}</td>
                        </tr>

                        <tr>
                            <th><label>Page Text:</label></th>
                            <td>${questionSet.text}</td>
                        </tr>

                        <tr>
                            <th><label>Description:</label></th>
                            <td>${questionSet.description}</td>
                        </tr>

                        <tr>
                            <th><label>Help Text:</label></th>
                            <td>${questionSet.helpText}</td>
                        </tr>
                    </table>
                </div>
                <table width="380" border="0" cellspacing="4" class="formlayout_table fr">
                    <tr>
                        <th width="160"><label>Sibling ID:</label></th>
                        <td width="220">
                            <c:if test="${not empty questionSet.sibling}">
                            ${questionSet.sibling.refId}
                            </c:if>
                        </td>
                    </tr>

                    <tr>
                        <th><label>Sibling Version:</label></th>
                        <td>
                            <c:if test="${not empty questionSet.sibling}">
                            ${questionSet.sibling.version}
                            </c:if>
                        </td>
                    </tr>

                    <tr>
                        <th><label>Status:</label></th>
                        <td>
                            ${questionSet.status.code}
                        </td>
                    </tr>

                    <tr>
                        <th><label>Availability:</label></th>
                        <td>${questionSet.availability.code}</td>
                    </tr>

                    <tr>
                        <th><label>Last Modified Date:</label></th>
                        <td>
                            <fmt:formatDate value="${questionSet.modifiedOn}" pattern="dd-MMM-yyyy" />
                        </td>
                    </tr>

                    <tr>
                        <th><label>Last Modified By:</label></th>
                        <td>
                            ${questionSet.modifiedBy.username}
                        </td>
                    </tr>

                    <tr>
                        <th><label>Retired By:</label></th>
                        <td>

                        </td>
                    </tr>

                    <tr>
                        <th><label>Retire Date:</label></th>
                        <td>

                        </td>
                    </tr>
                    <form id="questionSet" method="post">
                        <input type="hidden" id="submitAction" name="submitAction" />
                        <input type="hidden" id="from" name="from" />
                        <tr>
                            <th><label>Retire Notes:</label></th>
                            <td>
                                <textarea name="retiredNote"></textarea>
                            </td>
                        </tr>
                    </form>
                </table>
            </div>
            <ul class="functions1">
                <ul class="functions1">
                    <li>
                        <input type="image" src="<%= request.getContextPath()%>/images/btn/functions1/btn_save.gif"
                               class="btn" onclick="retireAction('SUBMIT_AND_VIEW');" />
                    </li>

                    <li>
                        <input type="image" onclick="retireAction('submit_and_exit');" class="btn" 
                               src="<%= request.getContextPath()%>/images/btn/functions1/btn_save_exit.gif" />
                    </li>

                    <li>
                        <a href="#" onclick="Dialogs.unescapedLink('cancel.html', 'from')">
                            <img src="<%= request.getContextPath()%>/images/btn/functions1/btn_cancel.gif" class="btn" />
                        </a>
                    </li>
                </ul>
            </ul>
            <div class="corners_bottom"></div>
        </div>

        <div class="message">${message}</div>
    </div>
</div>
<!--END: conent -->